package com.kelvem.saas.workbanch.ontology.order.handle.core;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.kelvem.saas.workbanch.fsm.container.DaoContainer;
import com.kelvem.saas.workbanch.fsm.core.EventContext;
import com.kelvem.saas.workbanch.fsm.dao.BaseDao;
import com.kelvem.saas.workbanch.fsm.entity.Entity;
import com.kelvem.saas.workbanch.fsm.handle.Handle;
import com.kelvem.saas.workbanch.ontology.order.model.OrdersEntity;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author kelvem
 */
@Service
@Slf4j
public class TestOrderHandle extends Handle {
    
    @Resource
    private DaoContainer daoContainer;
    
    @Override
    public void execute() {
        
        OrdersEntity order = Entity.instance().selectOne(OrdersEntity.class);
        BaseDao dao = DaoContainer.getDao(OrdersEntity.class);
        List<OrdersEntity> ordersList = dao.selectList(new LambdaQueryWrapper<OrdersEntity>());
    
        log.info("Handle[" + getName() + "] all_order=" + ordersList);
        EventContext.print();
    }
}
